package com.springcloudemo.ms.feigns;

import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class OpenFeignClienFallbackFactory implements FallbackFactory<OpenFeignClienFallbackFactory.OpenFeignClienFallbackInner> {


    static class OpenFeignClienFallbackInner implements OpenFeignClien {
        @Override
        public String echo(String string) {
            return "fallback";
        }
    }


    @Override
    public OpenFeignClienFallbackInner create(Throwable cause) {
        cause.printStackTrace();
        return new OpenFeignClienFallbackInner();
    }
}
